package Servlets;

import Dao.FettleDaoimpl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/Resigned")

public class Resigned extends HttpServlet {

    private static final long serialVersionUID = 1L;

    public Resigned() {
        super();
    }


    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

// TODO Auto-generated method stub

        request.setCharacterEncoding("UTF-8");
        response.setCharacterEncoding("UTF-8");

        response.setContentType("text/html;charset=UTF-8");

        String id = request.getParameter("id");
        int fid = Integer.parseInt(id);
        String emt = null;
        String cw = null;
        FettleDaoimpl fe = new FettleDaoimpl();
        try {
            fe.DeletesignedById(fid);

            request.getRequestDispatcher("/Emsigned").forward(request, response);


        } catch (Exception e) {

// TODO Auto-generated catch block

            e.printStackTrace();

        }

    }


    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

// TODO Auto-generated method stub

        doGet(request, response);

    }


}
